package com.shouke.jmeter.plugin.httpFileUpload.sampler;

import java.io.Serializable;

// dubbo接口参数实体类，需要实现序列化，否则可能报错
public class HeaderArgument implements Serializable {
    private String headerName;
    private String headerValue;

    public HeaderArgument(String headerName, String headerValue) {
        this.setHeaderName(headerName);
        this.setHeaderValue(headerValue);
    }

    public void setHeaderName(String headerName) {
        // 如果参数类型为null，则为设置为null,否则设置为请求头名称去掉有空白(空格，tab等)字符后的值
        this.headerName = (headerName == null ? null : headerName.replaceAll("\\s*", ""));
    }

    public String getHeaderName() {
        return this.headerName;
    }

    public String getHeaderValue() {
        return this.headerValue;
    }


    public void setHeaderValue(String headerValue) {
        this.headerValue = (headerValue == null ? null : headerValue);
    }
}
